<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 筛选出数组中大于等于10的数放入新数组

        // 筛选语法
        var arr = [1, 20, 54, 45, 60 ,80];
        var newArr = [];
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] >= 10) {
                newArr.push(arr[i]);
            }
        }
        console.log(newArr);

        // 查找语法（找没找到）
        var arr = [1, 20, 54, 45, 60 , 80, 0, 0, -10];
        var flag = false;
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] < 0) {
                flag = true;
                break;
            }
        }
        console.log(flag);

        // 查找语法（找到几个）
        var arr = [1, 20, 54, 45, 60 , 80, 0, 0, -10, -20,-20];
        var count = 0;
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] < 0) {
                count++;
            }
        }
        console.log(count);
    </script>
</body>
</html>